<?php
include("../../includes/config.php");
include("../../includes/db.php");
$id = $_GET['id'];
if (isset($_COOKIE["user"]))
{
$author = $_COOKIE["user"];
$query = "SELECT * FROM users WHERE status='2'";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
if ($_COOKIE["user"] == $row['username'])
{
if ($_COOKIE["pass"] ==  $row["password"])
{
$query = "DELETE FROM news WHERE id='$id'";
mysql_query($query);
header("Location: $site_url");
}
}
}
}